<?php

namespace app\api\controller\shop;

use app\admin\model\shop\Category;
use app\common\controller\Api;

/**
 * 商户投诉接口
 */
class Shopcomplain extends Api
{
    protected $noNeedRight = ['*'];


    //投诉类型
    public function complain()
    {
        $shop_complain_model = new \app\api\model\shop\ShopComplain();

        $lists = $shop_complain_model->getComplain();

        $this->success('',$lists);
    }

    //投诉提交
    public function create()
    {
        $params = input();
        try {
            $shop_complain_model = new \app\api\model\shop\ShopComplain();
            $params['user_id'] = $this->auth->id;
            $res = $shop_complain_model->add($params);

        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('',$res);
    }
}